package t20220204;

/**
 * @Author: DengJia
 * @Date: 2022/2/4 16:29
 * @Description: 异常丢失
 */

class VeryImportantException extends Exception {
    public String toString() {
        return "a very important exception!";
    }
}

class HoHumException extends Exception {
    public String toString() {
        return "a trivial exception~";
    }
}

public class LostMessage {
    void f() throws Exception {
        throw new VeryImportantException();
    }

    void dispose() throws Exception {
        throw new HoHumException();
    }

    public static void main(String[] args) {
        // doThis();
        try {
            throw new RuntimeException();
        } finally {
            return;
        }
    }

    public static void doThis() {
        try {
            LostMessage lm = new LostMessage();
            try {
                lm.f();
            } finally {
                lm.dispose();
            }
        } catch (Exception e) {
            System.out.println(e);
        }
    }
}
